package com.whl.sm.vo;


import com.whl.sm.model.assets.ComUnits;
import com.whl.sm.model.inhabitant.AssetsOwner;
import com.whl.sm.model.system.OrgUserInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class OrgUserAssetsOwnerVO {

    public OrgUserAssetsOwnerVO(OrgUserInfo orgUserInfo, AssetsOwner assetsOwner, ComUnits comUnits){
        if (assetsOwner != null){
            this.id = assetsOwner.getId();
            this.ownerType = assetsOwner.getOwnerType();
            this.visible = assetsOwner.getVisible();
            this.createTime = assetsOwner.getCreateTime();
            this.updateTime = assetsOwner.getUpdateTime();
        }
        if (orgUserInfo != null){
                this.userName = orgUserInfo.getUserName();
                this.linkTel = orgUserInfo.getLinkTel();
                this.linkMail = orgUserInfo.getLinkMail();
                this.gender = orgUserInfo.getGender();
                this.avatar = orgUserInfo.getAvatar();
                this.birthday = orgUserInfo.getBirthday();
        }
        if (comUnits != null){
            this.assetsId = comUnits.getId();
            this.unitCode = comUnits.getUnitCode();
            this.unitArea = comUnits.getUnitArea();
        }
    }

    /**
     * owner表id
     */
    private String id;

    /**
     * 用户姓名
     */
    private String userName;

    /**
     * 单元id
     */
    private String assetsId;


    /**
     * 单元编号
     */
    private String unitCode;


    /**
     * 单元面积
     */
    private double unitArea;

    /**
     * 业主角色类型 1:户主  0:成员
     */
    private Integer ownerType;


    /**
     * 生效状态 1:正常 2:停用
     */
    private Integer visible;


    /**
     * 联系电话
     */
    private String linkTel;

    /**
     * 联系邮箱
     */
    private String linkMail;

    /**
     * 头像图片路径
     */
    private String avatar;

    /**
     * 性别 0:female 1:male
     */
    private Integer gender;

    /**
     * 生日
     */
    private String birthday;


    /**
     * 更新时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;


}
